package com.example.controller;

import com.example.model.LearningPath;
import com.example.service.LearningService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/api/learning")
public class LearningController {
    @Autowired
    private LearningService learningService;
    
    @PostMapping("/resume/analyze")
    public Map<String, Object> analyzeResume(@RequestBody String resumeContent) {
        return learningService.analyzeResume(resumeContent);
    }
    
    @PostMapping("/paths")
    public LearningPath createLearningPath(@RequestParam String topic) {
        return learningService.createLearningPath(topic);
    }
    
    @GetMapping("/feedback/{questionId}")
    public String getInterviewFeedback(@PathVariable Long questionId) {
        return learningService.getInterviewFeedback(questionId);
    }
    
    @GetMapping("/progress")
    public Map<String, Object> getLearningProgress() {
        return learningService.getLearningProgress();
    }
    
    @GetMapping("/paths/{id}")
    public LearningPath getLearningPath(@PathVariable Long id) {
        return learningService.getLearningPath(id);
    }
} 